import 'package:flutter/material.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:tu_home/order/order-card.dart';

class OrderList extends StatefulWidget {
  const OrderList({super.key});

  @override
  State createState() {
    return OrderListState();
  }
}


class OrderListState extends State<OrderList> {

  int count = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: EasyRefresh(
        // 下拉样式
        header: TDRefreshHeader(),
        child: ListView(
          children: [
            OrderCard(),
            OrderCard(),
            OrderCard(),
            OrderCard(),
            OrderCard(),
            OrderCard(),
            OrderCard()],
        ),
        // 下拉刷新回调
        onRefresh: () async {
          await Future.delayed(const Duration(seconds: 2), () {
            setState(() {
              count++;
            });
          });
        },
      ),
    );
  }
}

